home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / include / Xm / LabelP.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-06-30  |  5.0 KB  |  156 lines

  1. /* 
  2.  * (c) Copyright 1989, 1990, 1991, 1992, 1993 OPEN SOFTWARE FOUNDATION, INC. 
  3.  * ALL RIGHTS RESERVED 
  4. */ 
  5. /* 
  6.  * Motif Release 1.2.3
  7. */ 
  8. /*   $RCSfile: LabelP.h,v $ $Revision: 10.1 $ $Date: 1994/02/03 15:42:32 $ */
  9. /*
  10. *  (c) Copyright 1989, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
  11. /*
  12. *  (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 HEWLETT-PACKARD COMPANY */
  13. #ifndef _XmLabelP_h
  14. #define _XmLabelP_h
  15.  
  16. #include <Xm/Label.h>
  17. #include <Xm/PrimitiveP.h>
  18.  
  19.  
  20. #define XmUNSPECIFIED        (~0)
  21.  
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25.  
  26. /*  The Label Widget Class and instance records  */
  27.  
  28. typedef struct _XmLabelClassPart     /* label class record */
  29. {
  30.         XtWidgetProc    setOverrideCallback;
  31.     XmMenuProc    menuProcs;
  32.         String  /* XtTranslations */  translations;
  33.         XtPointer        extension; /* Pointer to extension record */
  34. } XmLabelClassPart;
  35.  
  36. typedef struct _XmLabelClassRec
  37. {
  38.     CoreClassPart        core_class;
  39.     XmPrimitiveClassPart primitive_class;
  40.     XmLabelClassPart     label_class;
  41. } XmLabelClassRec;
  42.  
  43. externalref XmLabelClassRec xmLabelClassRec;
  44.  
  45.  
  46. /* Inherited  Functions exported by label */
  47.  
  48. #define XmInheritSetOverrideCallback ((XtWidgetProc) _XtInherit)
  49. #define XmInheritResize  ((XtWidgetProc) _XtInherit)
  50. #define XmInheritRealize  ((XtRealizeProc) _XtInherit)
  51.  
  52. /* The padding between label text and accelerator text */
  53.  
  54. # define LABEL_ACC_PAD         15
  55.  
  56. /*  The Label instance record  */
  57.  
  58. typedef struct _XmLabelPart
  59. {
  60.     _XmString    _label;  /* String sent to this widget */
  61.         _XmString    _acc_text;
  62.      KeySym        mnemonic;
  63. /**        char            mnemonic;    **/
  64.         XmStringCharSet mnemonicCharset;
  65.         char         *accelerator;
  66.         unsigned char    label_type;
  67.         unsigned char    alignment;
  68.         unsigned char    string_direction;
  69.         XmFontList    font;
  70.     
  71.     Dimension    margin_height;   /* margin around widget */
  72.         Dimension    margin_width;
  73.  
  74.     Dimension     margin_left;    /* additional margins on */
  75.         Dimension    margin_right;   /* each side of widget */
  76.         Dimension    margin_top;     /* text (or pixmap) is placed */
  77.         Dimension    margin_bottom;  /* inside the margins */
  78.  
  79.         Boolean     recompute_size;
  80.  
  81.         Pixmap        pixmap; 
  82.         Pixmap        pixmap_insen; 
  83.  
  84.         /* PRIVATE members -- values computed by LabelWidgetClass methods */
  85.  
  86.         GC        normal_GC;   /* GC for text */    
  87.         GC        insensitive_GC;
  88.         XRectangle    TextRect;    /* The bounding box of the text, or clip
  89.                                         rectangle of the window; whichever is
  90.                                         smaller */
  91.         XRectangle    acc_TextRect; /* The bounding box of the text, or clip
  92.                                         rectangle of the window; whichever is
  93.                                         smaller */
  94.  
  95.     Boolean        skipCallback; /* set by RowColumn when entryCallback
  96.                     is provided. */
  97.     unsigned char   menu_type;
  98.  
  99. } XmLabelPart;
  100.  
  101.  
  102. typedef struct _XmLabelRec
  103. {
  104.    CorePart         core;
  105.    XmPrimitivePart  primitive;
  106.    XmLabelPart        label;
  107. } XmLabelRec;
  108.  
  109. /* MACROS */
  110.  
  111. #define Lab_MarginWidth(w)        (((XmLabelWidget)(w)) ->label.margin_width)
  112. #define Lab_MarginHeight(w)        (((XmLabelWidget)(w)) ->label.margin_height)
  113. #define Lab_MarginTop(w)        (((XmLabelWidget)(w)) ->label.margin_top)
  114. #define Lab_MarginBottom(w)        (((XmLabelWidget)(w)) ->label.margin_bottom)
  115. #define Lab_MarginRight(w)        (((XmLabelWidget)(w)) ->label.margin_right)
  116. #define Lab_MarginLeft(w)        (((XmLabelWidget)(w)) ->label.margin_left)
  117. #define Lab_TextRect_x(w)        (((XmLabelWidget)(w)) ->label.TextRect.x)
  118. #define Lab_TextRect_y(w)        (((XmLabelWidget)(w)) ->label.TextRect.y)
  119. #define Lab_TextRect_width(w)        (((XmLabelWidget)(w)) ->label.TextRect.width)
  120. #define Lab_TextRect_height(w)        (((XmLabelWidget)(w)) ->label.TextRect.height)
  121.  
  122. #define Lab_IsText(w)            (((XmLabelWidget)(w)) ->label.label_type == XmSTRING)
  123. #define Lab_IsPixmap(w)            (((XmLabelWidget)(w)) ->label.label_type == XmPIXMAP)
  124.  
  125. #define Lab_Font(w)            (((XmLabelWidget)(w)) ->label.font)
  126.  
  127. #define Lab_Mnemonic(w)            (((XmLabelWidget)(w)) ->label.mnemonic)
  128. #define Lab_Accelerator(w)        (((XmLabelWidget)(w)) ->label.accelerator)
  129. #define Lab_AcceleratorText(w)        (((XmLabelWidget)(w)) ->label.acc_text)
  130. #define Lab_MenuType(w)            (((XmLabelWidget)(w))->label.menu_type)
  131. #define Lab_Shadow(w)                   (((XmLabelWidget)(w))->primitive.shadow_thickness)
  132. #define Lab_Highlight(w)                (((XmLabelWidget)(w))->primitive.highlight_thickness)
  133. #define Lab_Baseline(w)                 (_XmStringBaseline ( \
  134.                                          ((XmLabelWidget)(w))->label.font,\
  135.                                          ((XmLabelWidget)(w))->label._label))
  136. /********    Private Function Declarations    ********/
  137. #ifdef _NO_PROTO
  138.  
  139. extern void _XmCalcLabelDimensions() ;
  140.  
  141. #else
  142.  
  143. extern void _XmCalcLabelDimensions( 
  144.                         Widget wid) ;
  145.  
  146. #endif /* _NO_PROTO */
  147. /********    End Private Function Declarations    ********/
  148.  
  149.  
  150. #ifdef __cplusplus
  151. }  /* Close scope of 'extern "C"' declaration which encloses file. */
  152. #endif
  153.  
  154. #endif /* _XmLabelP_h */
  155. /* DON'T ADD ANYTHING AFTER THIS #endif */
  156.